getApp();

var s = require("../../../utils/http.js");

Page({
    data: {
        code: "",
        success: !1,
        status: "",
        msg: "",
        grade: "",
        successImg: ""
    },
    onLoad: function(s) {},
    onReady: function() {},
    onShow: function() {
        var o = this;
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    inputLength: function(s) {
        this.setData({
            code: s.detail.value
        });
    },
    submit: function(o) {
        var t = this;
        s.post("/app/dock/weiboduijiang", {
            code: t.data.code,
            validate: {
                code: "请输入兑换码"
            }
        }, !1, function(s) {
            console.log('s',s);
            0 == s.code && wx.showToast({
                title: s.msg,
                icon: "none"
            });
            1 == s.type &&  wx.redirectTo({
                url: "/pages/member/coupon/coupon"
            });
            2 == s.type &&  wx.redirectTo({
                url: "/pages/member/index/index"
            });
        });
    },
    closemodel: function() {
        this.setData({
            success: !1
        });
    },
    
});